package utiil;

import java.util.List;

public class ArrayUtil {
    public static int[][] twoDimensionalInit(int[][] item){
        return twoDimensionalInit(item.length,item[0].length);
    }

    public static int[][] twoDimensionalInit(int i,int j){
        return new int[i][j];
    }
    public static int[][] copy(int[][] item){
        int[][] copy = twoDimensionalInit(item);
        for (int a=0;a<item.length;a++){
            for (int b=0;b<item[a].length;a++){
                copy[a][b]=item[a][b];
            }
        }
        return copy;
    }

    public static boolean isSame(int[][] now, int[][] end) {
        if(now.length!=end.length){
            return false;
        }
        for(int a=0;a<now.length;a++){
            if(now[a].length!=end[a].length){
                return false;
            }
            for (int b=0;b<now[a].length;b++){
                if(now[a][b]!=end[a][b]){
                    return false;
                }
            }
        }
        return true;
    }

    public static void showArr(List<?> index) {
        for(Object o :index){
            System.out.println(o+" ");
        }
    }
}
